home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d3 / shofkeys.arc / SHOFKEYS.DOC < prev    next >
Text File  |  1988-07-28  |  7KB  |  158 lines

  1. ShoFKeys --
  2.  
  3.     I hate keyboard templates.    They catch on your sleeve, they clutter the
  4. typing area, you can never find them unless you Scotch-tape them to the
  5. keyboard, and then it's a pain in the lobotomy to swap the right one in
  6. place when you need it.  Nuts.
  7.  
  8.     Unfortunately, for mere mortal nerds like myself they are necessary.
  9. I remember about six function keys (out of the forty possible ones using
  10. SHIFT, ALT and CTRL) for each of the programs I use regularly.    That is
  11. equally true for tools where I'm stuck with the key choices (like CodeView)
  12. and for editors that allow me to remap the keyboard (like MicroEMACS).
  13.  
  14.     I spend a lot of time in CodeView, so that's the template permanently
  15. affixed to my keyboard.  MicroEMACS has help screens available, so I can
  16. get along without a template there.
  17.  
  18.     WordPerfect, however, drives me bonkers.  As a document preparation
  19. system, its power and flexibility are essential... but they use every
  20. damned one of those 40 function key combinations, and I can't for the
  21. life of me remember which is which at 3 in the morning.
  22.  
  23.     A couple of nights ago, I got fed up with hitting F3 F3, and hacked
  24. together ShoFKeys.  It's a pretty simple-minded program, but it works for
  25. me.  Here's what it does:
  26.  
  27.     1) When run from the prompt, ShoFKeys intercepts the "keypress"
  28.        interrupt (INT 9), redirects it through a "hotkey" test and
  29.        a test for change in shift status (i.e., is CTRL or SHIFT or
  30.        ALT pressed?), determines what kind of video adapter the
  31.        system is using, and terminates leaving the meat of itself
  32.        in memory, but dormant.
  33.  
  34.     2) When the user hits the "hotkey" combination CTRL-LEFTSHIFT-F,
  35.        ShoFKeys toggles itself into the ACTIVE state.  Another
  36.        CTRL-LEFTSHIFT-F will toggle it INACTIVE again.
  37.  
  38.     3) When ACTIVE, the routine tests the shift state at every keypress
  39.        or keyrelease.  If that shift state has CHANGED since the last
  40.        time ShoFKeys displayed a set of function keys, it saves the new
  41.        shift state and selects one of four 160-byte blocks of data.
  42.        Each of these blocks contains 80 words of screen data (in
  43.        character-plus-video attribute format), or a full 80-character
  44.        row.  ShoFKeys determines the last row on the display (always
  45.        #24 on a monochrome or CGA system, might be #24, #42 or some
  46.        other value on an EGA) and copies the 160-byte block directly
  47.        into the video memory.
  48.  
  49.      When ShoFKeys is activated, the bottom line of the display shows 10
  50. sets of function key mnemonics, each 8 characters wide.  The first character
  51. of each eight is highlighted, the other seven are not.    (On my screen, the
  52. first -- highlighted -- character is a digit 1, 2, 3... 0 to indicate the
  53. function key number, and the other seven characters contain the name of
  54. the function distilled into a clever 7-letter abbrvtn.)  (The colors I use
  55. on my EGA -- bright blue highlight, grey normal -- happen to work nicely
  56. on a monochrome monitor.  The "highlight" is high-intensity underlined,
  57. the rest is low-intensity.  However, if you prefer reverse video, blinking,
  58. or strange color combos, you need only change two equates and re-assemble
  59. the source.)
  60.  
  61.      Press any of the "shift" keys -- SHIFT, CTRL or ALT -- and the list
  62. of "normal" function key mnemonics is replaced instantly with the appropriate
  63. CTRL, SHIFT or ALT fkey list.  Release ALT or whatever, and the unshifted
  64. key mnemonics immediately re-appear.
  65.  
  66.      Because ShoFKeys determines the number of rows on-screen at KEYPRESS
  67. time rather than at LOAD time, you can change an EGA's characteristics and
  68. the function keys will still appear at the bottom of the screen.  This is real
  69. handy if you like to edit in 43-line mode to see more of a document at one
  70. time.
  71.  
  72.      ShoFKeys works real well with WordPerfect (and some other editors I
  73. use like MicroEMACS) because you can specify the number of on-screen rows
  74. that WordPerfect uses.    Run  WP/S  and set the screen characteristics.
  75. Normally, you would tell WordPerfect that you have a 25-line screen.  Say
  76. instead that your screen is 24 lines long.  WordPerfect configures itself
  77. to put your document on rows 0-22, places its status line on row 23, and
  78. leaves row 24 free for your function-key mnemonics.  I edit with a "42-line"
  79. WordPerfect screen, using 0-41 for WordPerfect and leaving row 42 free for
  80. my function keys.
  81.  
  82.      Like I said, ShoFKeys is dumb.  It does NOT preserve the previous
  83. contents of the last row on-screen, and it is not smart enough to stay out
  84. of the way of programs that use that last row.    In particular, if you drop
  85. back to DOS and forget to de-activate it (via CTRL-LEFTSHIFT-F), you'll
  86. see copies of the function key lists rolling up-screen as your prompt
  87. reaches the last row.
  88.  
  89.      However, it's easy enough to turn the thing off when you're not using
  90. it, it only takes up about 1100 bytes of RAM, doesn't add any noticeable
  91. overhead to typing speed, and it's saved me a few trips to the manual shelf.
  92.  
  93.      Some ideas for enhancements that I might tackle someday, if someone
  94. doesn't beat me to it (hint, hint...) --
  95.  
  96.      -- prevent multiple copies of ShoFKeys from being loaded.
  97.  
  98.      -- load a text for function key list from a command-line filename
  99.      (should REPLACE previously resident text in the FIRST
  100.       copy of ShoFKeys in RAM)
  101.  
  102.      -- Display mnemonics as a pop-up block, rather than a single
  103.       line at the bottom.  This would both allow fuller mnemonic
  104.       texts and not require specially-configured software that
  105.       doesn't use the last row.  It would require watching the
  106.       keystrokes more closely than the present program does, though,
  107.       to know when to save and restore "real" screen contents.
  108.  
  109.      Have fun!
  110.  
  111.           ================================================
  112.  
  113. ShoFKeys is written in a "structured assembly language".  The following files
  114. are included in this archive:
  115.  
  116. read.me     -- you're doing it
  117.  
  118.  
  119. strux.exe    -- preprocessor for "structured" assembly language.
  120.            STRUX SHOFKEYS generates SHOFKEYS.ASM (MASM compatible)
  121.            from the structured source SHOFKEYS.A
  122.  
  123. shofkeys.    -- MAKE file for SHOFKEYS.  I use NDMAKE, an excellent
  124.            UNIX-compatible MAKE.
  125.  
  126. shofkeys.a    -- source code for SHOFKEYS. see STRUX above.
  127.  
  128. shofkeys.com    -- runnable form.
  129.  
  130. fkeytext.c    -- generates the appropriate DB statements for inclusion
  131.             in SHOFKEYS.A for a set of 4 text lines, such as
  132.  
  133. fkeytext.lst    -- text (4 text lines) for WordPerfect function keys
  134.  
  135.  
  136. -- Two useful programs NOT included in this archive (because they're not mine)
  137.     are NDMAKE and EXE2COM.  They are not absolutely necessary --
  138.     you can assemble and link "by hand" and use EXE2BIN instead --
  139.     but they're real convenient and recommended.  You'll probably
  140.     find them on the same BBS you got this from, or one nearby.
  141.  
  142.  
  143.  
  144. If you like the program, have fun with it.
  145.  
  146. If you feel like modifying it, go ahead.  It's in the public domain.
  147.  
  148. If you don't like it at all, I don't promise to be crushed by your criticism.
  149.  
  150.  
  151.  
  152.  
  153. Davidson Corry
  154. 4610 SW Lander
  155. Seattle, WA  98116
  156.  
  157. (206) 935-0244
  158.